import React from 'react'
import PT from 'prop-types'
import cls from 'classnames'
import './index.scss'

const ImgText = props => {
  const {img = '', text = '', checked = false, type = 0} = props
  return (
    <div
      className={cls('imgText-box', `imgText-box-${type}`, {
        'imgText-box--checked': checked,
      })}
    >
      <div className="img-wrap">
        <img className="img" alt="" src={img}/>
      </div>
      <p>{text}</p>
    </div>
  )
}

ImgText.propTypes = {
  img: PT.string.isRequired,
  text: PT.string.isRequired,
  checked: PT.bool.isRequired,
}

export default ImgText
